package com.wangfugui.mybatisplus.service.impl;

import com.alibaba.excel.util.DateUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wangfugui.mybatisplus.dao.DailyPnlDao;
import com.wangfugui.mybatisplus.dao.RestScheduleDao;
import com.wangfugui.mybatisplus.domain.DailyPnl;
import com.wangfugui.mybatisplus.domain.RestSchedule;
import com.wangfugui.mybatisplus.service.DailyPnlService;
import com.wangfugui.mybatisplus.service.RestScheduleService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;

import java.time.LocalDate;
import java.time.YearMonth;
import java.time.ZoneId;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;


@Service
@Slf4j
public class RestScheduleServiceImpl extends ServiceImpl<RestScheduleDao, RestSchedule> implements RestScheduleService {

    @Override
    public List<String> getRestList() {
        return list().stream().map(RestSchedule::getDate)
                .map(date -> DateUtils.format(date,"yyyy/MM/dd"))
                .collect(Collectors.toList());
    }
}
